package model

import (
	"360-cinema/user-server/basic/config"
	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Phone    string `gorm:"type:char(11);comment:手机号"`
	Password string `gorm:"type:char(32);comment:密码"`
	Username string `gorm:"type:varchar(30);comment:用户昵称"`
	Avatar   string `gorm:"type:varchar(300);comment:用户头像"`
	Status   string `gorm:"type:varchar(30);comment:用户状态"`
}

func RegisterUser(u *User) error {

	return config.DB.Create(&u).Error
}
